import axios from "../utils/request";
// 获取商品列表
export const getShopList = query => {
	// {pageIndex:1,pageSize:10} == /list?pageIndex=1&pageSize=10
	return axios.get("/list", { params: query });
};
// 详情
export const getShopDetail = id => {
	return axios.get("/list/" + id);
};
// 加入购物车
export const addToCart = query => {
	return axios.get("/cart/add", { params: query });
};
// 获取购物车列表
export const getCartList = () => {
	return axios.get("/cart/list");
};
// 设置购物车商品数量
export const setCartCount = query => {
	return axios.get("/cart/setcount", { params: query });
};
// 删除购物车商品
export const deleteCart = body => {
	return axios.post("/cart/delete", body);
};
// 登录
export const login = query => {
	return axios.get("/login", { params: query });
};
// 注册
export const register = query => {
	return axios.get("/register", { params: query });
};
